package com.jgsu.farm.controller;


import com.jgsu.farm.service.*;

import io.swagger.annotations.Api;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@Api(value = "farm/sysuser/inquiry", tags = "问诊信息管理模块")  //描述信息用的，标注在类上
@RestController
@RequestMapping("farm/sysuser/inquiry")
public class InquiryController {
    @Autowired
    InquiryService inquiryService;
    @Autowired
    ImageService imageService;
    @Autowired
    Match_ImageService matchImageService;
    @Autowired
    VideoService videoService;
    @Autowired
    PlantService plantService;
    @Autowired
    SpectralService spectralService;


    /**
     * 问诊信息信息管理API，待扩展。。。
     * */


  /*  *//**
     * 问诊信息删除
     * *//*
    @ApiOperation(value = "问诊信息删除功能")
    @PostMapping(value = "/delete", produces = "application/json")
    public CommonResult inquiryDelete(@RequestParam("inquiryid") Integer inquiryid) {
        try {
            inquiryService.delete(inquiryid);
            log.info("删除id为：{}的问诊信息",inquiryid);
            return CommonResult.success(ResultCode.SUCCESS);
        } catch (DataNotExistException dde) {
            log.error("不存在id为："+inquiryid+"的问诊信息，删除失败");
            throw new DataNotExistException(dde.getCode(), dde.getMessage());
        }
    }

    *//**
     * 问诊信息修改
     * *//*
    @ApiOperation(value = "问诊信息修改功能")
    @PostMapping(value = "/update", produces = "application/json")
    public CommonResult inquiryUpdate(Inquiry inquiry) {
        try {
             inquiryService.update(inquiry);
            log.info("问诊信息更新，更新id为：{}",inquiry.getInquiryid());
            return CommonResult.success(inquiry);
        } catch (DataNotExistException due) {
            log.error("更新id = {}的问诊信息失败",inquiry.getInquiryid());
            throw new DataNotExistException(due.getCode(), due.getMessage());
        }
    }*/
}
